﻿#region << 版 本 注 释 >>
/*----------------------------------------------------------------
 * 修改人：
 * 时间：
 * 修改说明：为所有属性添加JsonPropertyName特性，统一使用小驼峰命名
 *----------------------------------------------------------------*/
#endregion << 版 本 注 释 >>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace seejee_Backendium.Core.Models
{
    public class DashboardItemDto
    {
        // 基础属性（所有子项通用）
        [JsonPropertyName("id")]
        public string? Id { get; set; }

        [JsonPropertyName("type")]
        public string? Type { get; set; }

        [JsonPropertyName("span")]
        public int? Span { get; set; }

        [JsonPropertyName("height")]
        public int? Height { get; set; }

        [JsonPropertyName("title")]
        public string? Title { get; set; }

        [JsonPropertyName("titleColor")]
        public string? TitleColor { get; set; }

        [JsonPropertyName("titleSize")]
        public int? TitleSize { get; set; }

        [JsonPropertyName("headerColor")]
        public String? HeaderColor { get; set; }

        [JsonPropertyName("backgroundColor")]
        public string? BackgroundColor { get; set; }

        [JsonPropertyName("backgroundStyle")]
        public string? BackgroundStyle { get; set; }

        [JsonPropertyName("sqlList")]
        public List<string>? SqlList { get; set; } = new List<string>();

        [JsonPropertyName("sort")]
        public int? Sort { get; set; }

        // 翻牌器特有属性
        [JsonPropertyName("valueColor")]
        public string? ValueColor { get; set; }

        [JsonPropertyName("valueSize")]
        public int? ValueSize { get; set; }

        [JsonPropertyName("unit")]
        public string? Unit { get; set; }

        [JsonPropertyName("unitSize")]
        public int? UnitSize { get; set; }

        [JsonPropertyName("iconImage")]
        public string? IconImage { get; set; }

        [JsonPropertyName("iconColor")]
        public string? IconColor { get; set; }

        [JsonPropertyName("iconSize")]
        public string? IconSize { get; set; } = string.Empty;

        [JsonPropertyName("ringColor")]
        public string? RingColor { get; set; } = string.Empty;

        [JsonPropertyName("ringValue")]
        public string? RingValue { get; set; } = string.Empty;

        [JsonPropertyName("iconPosition")]
        public string? IconPosition { get; set; }

        [JsonPropertyName("thousandSeparator")]
        public bool? ThousandSeparator { get; set; }

        [JsonPropertyName("leftUnit")]
        public string? Leftunit { get; set; }

        [JsonPropertyName("leftUnitSize")]
        public string? leftunitsize { get; set; }
        [JsonPropertyName("layoutDirection")]
        public string? layoutDirection { get; set; }
        public string? buttonshow { get; set; }
        public string[]? buttonname { get; set; }
        public string[]? buttonsql { get; set; }

        // 折线图特有属性
        [JsonPropertyName("lines")]
        public List<LineConfig>? Lines { get; set; } = new List<LineConfig>();

        [JsonPropertyName("xAxisData")]
        public List<string>? XAxisData { get; set; } = new List<string>();

        [JsonPropertyName("data")]
        public List<List<double>>? Data { get; set; } = new List<List<double>>();

        // 柱状图特有属性
        [JsonPropertyName("bars")]
        public List<BarConfig>? Bars { get; set; } = new List<BarConfig>();

        [JsonPropertyName("barCategoryGap")]
        public string? BarCategoryGap { get; set; }

        [JsonPropertyName("barGap")]
        public string? BarGap { get; set; }

        // 表格特有属性
        [JsonPropertyName("tableHeight")]
        public int? TableHeight { get; set; }

        [JsonPropertyName("scrollSpeed")]
        public int? ScrollSpeed { get; set; }

        [JsonPropertyName("updateKey")]
        public double? UpdateKey { get; set; }

        [JsonPropertyName("header")]
        public List<List<string>>? Header { get; set; } = new List<List<string>>();


        [JsonPropertyName("prop")]
        public List<List<string>>? prop { get; set; } = new List<List<string>>();

        [JsonPropertyName("tableData")]
        public List<List<string>>? TableData { get; set; } = new List<List<string>>();

        [JsonPropertyName("index")]
        public bool? Index { get; set; }

        [JsonPropertyName("columnWidth")]
        public List<List<string>>? ColumnWidth { get; set; } = new List<List<string>>();

        [JsonPropertyName("align")]
        public List<string>? Align { get; set; } = new List<string>();

        [JsonPropertyName("headerBgColor")]
        public string? HeaderBgColor { get; set; }

        [JsonPropertyName("rowBgColors")]
        public List<string>? RowBgColors { get; set; } = new List<string>();
        public string? oddRowBGC { get; set; }
        public string? evenRowBGC { get; set; }
        public int? visibleRows { get; set; }
        public int? indexColumnWidth { get; set; }
        [JsonPropertyName("textStyle")]
        public TextStyleConfig? TextStyle { get; set; } = new TextStyleConfig();

        [JsonPropertyName("decoration")]
        public DecorationConfig? Decoration { get; set; } = new DecorationConfig();

        // 圆饼图和环形图独有的属性
        [JsonPropertyName("pieRingData")]
        public List<Dictionary<string, object>>? PieRingData { get; set; } = new List<Dictionary<string, object>>();

        [JsonPropertyName("radius")]
        public string[]? Radius { get; set; }

        [JsonPropertyName("labelShow")]
        public bool? LabelShow { get; set; }

        // 文本组件特有属性
        [JsonPropertyName("content")]
        public string? Content { get; set; }

        [JsonPropertyName("textAlign")]
        public string? TextAlign { get; set; }

        [JsonPropertyName("fontSize")]
        public int? FontSize { get; set; }

        [JsonPropertyName("fontWeight")]
        public string? FontWeight { get; set; }

        [JsonPropertyName("fontColor")]
        public string? FontColor { get; set; }

        [JsonPropertyName("lineHeight")]
        public double? LineHeight { get; set; }
    }

    // 辅助类：折线图线条配置
    public class LineConfig
    {
        [JsonPropertyName("name")]
        public string? Name { get; set; }

        [JsonPropertyName("color")]
        public string? Color { get; set; }
    }

    // 辅助类：柱状图柱子配置
    public class BarConfig
    {
        [JsonPropertyName("name")]
        public string? Name { get; set; }

        [JsonPropertyName("color")]
        public string? Color { get; set; }

        [JsonPropertyName("itemStyle")]
        public BarItemStyle? ItemStyle { get; set; } = new BarItemStyle();
    }

    // 辅助类：柱状图样式
    public class BarItemStyle
    {
        [JsonPropertyName("borderRadius")]
        public List<int>? BorderRadius { get; set; } = new List<int>();
    }

    // 辅助类：表格文本样式
    public class TextStyleConfig
    {
        [JsonPropertyName("fontSize")]
        public int? FontSize { get; set; }

        [JsonPropertyName("color")]
        public string? Color { get; set; }
    }

    // 辅助类：表格装饰配置
    public class DecorationConfig
    {
        [JsonPropertyName("show")]
        public bool? Show { get; set; }

        [JsonPropertyName("type")]
        public string? Type { get; set; }

        [JsonPropertyName("color")]
        public string? Color { get; set; }

        [JsonPropertyName("height")]
        public string? Height { get; set; }

        [JsonPropertyName("dur")]
        public int? Dur { get; set; }

        [JsonPropertyName("width")]
        public string? Width { get; set; }

        [JsonPropertyName("marginBottom")]
        public string? MarginBottom { get; set; }

        [JsonPropertyName("align")]
        public string? Align { get; set; }

        [JsonPropertyName("gradient")]
        public string? Gradient { get; set; }
    }
}
